import React from 'react';
import {Link} from "react-router-dom";

export default class ColumnTitleContainer extends React.Component {
    render() {
        let {
            title, to, children, titleRightRender, className,
            hasRightButton = true
        } = this.props;

        return (
            <div className={"column-title-container" + (className ? (' ' + className) : '')}>
                <div className="header font-size-28">
                    <span className={"font-size-30"}>{title}</span>
                    {
                        hasRightButton ?
                            to ?
                                <Link className={"link font-size-26"} to={to || '/'}><span>查看更多</span></Link>
                                : <a href="javascript:void(0);" className="link font-size-26"><span>查看更多</span></a>
                            : null
                    }
                    {titleRightRender}
                </div>
                <div className="children-group">
                    {children}
                </div>
            </div>
        );
    }
}